import request from '@/utils/request'

// 查询实有房屋列表
export function listEstate(query) {
  return request({
    url: '/system/estate/list',
    method: 'get',
    params: query
  })
}

// 查询实有房屋详细
export function getEstate(id) {
  return request({
    url: '/system/estate/' + id,
    method: 'get'
  })
}

// 新增实有房屋

export function addEstate(data) {
  return request({
    url: '/system/estate',
    method: 'post',
    data: data
  })
}

// 修改实有房屋

export function updateEstate(roomTypeId,id) {
  var data = {
    id:id,
    roomTypeId:roomTypeId
  }
  return request({
    url: '/system/estate',
    method: 'put',
    params: data
  })
}

// 删除实有房屋

export function delEstate(id) {
  return request({
    url: '/system/estate/' + id,
    method: 'delete'
  })
}

// 房屋类型统计
export function roomTypeCount(id){
  return request({
    url: `/system/estate/roomTypeCount/` + id,
    method: 'get'
  })
}

export function  threeAreasList(){
  return request({
    url: `/system/smartAreas/threeLevelAreasList`,
    method: 'get'
  })
}
export function  getAreasCode(areasId){
  return request({
    url: `/system/smartAreas/getAreasCode?areasId=`+areasId,
    method: 'get'
  })
}
export function getPlotById(id){
  return request({
    url: `/system/plot/selectPlotById?plotId=` + id,
    method: 'get'
  })
}
